#include "guideTable.h"


GuideTable::GuideTable(QWidget*parent)
{
    this->setParent(parent);
    _layout = new QVBoxLayout(this);
    _layout_text = new QHBoxLayout(this);
    _table_plan = new QTableWidget(this);
    _table_data = new QTableWidget(this);

    _widget_text = new QWidget(this);

    _table_plan->setEditTriggers(QAbstractItemView::NoEditTriggers);   // 设置每一行不可编辑
    _table_data->setEditTriggers(QAbstractItemView::NoEditTriggers);

    _label_Y = new QLabel("Y: 扩增效率:nan%, 斜率: nan, R2: 0.999, Y轴截距:nan", this);
    _label_AL = new QLabel("AS: 扩增效率:nan%, 斜率: nan, R2: 0.999, Y轴截距:nan", this);
    _label_AS = new QLabel("AL: 扩增效率:nan%, 斜率: nan, R2: 0.999, Y轴截距:nan", this);


    this->setStyleSheet("background: rgba(255,255,255,0.6); border-radius: 0px;");

    _label_Y->setStyleSheet("color: blue; background:rgba(255,255,255,0);");
    _label_AS->setStyleSheet("color: green; background:rgba(255,255,255,0);");
    _label_AL->setStyleSheet("color: red; background:rgba(255,255,255,0);");
    _widget_text->setStyleSheet("background:rgba(255,255,255,0.7);");

    _table_data->horizontalHeader()->setStyleSheet("QHeaderView::section{background:rgb(255, 255, 255);}");


    this->setLayout(_layout);
    _layout->setSpacing(0);
    _layout->addWidget(_table_plan);
    _layout->addWidget(_table_data);
    _layout->addWidget(_widget_text);
    _widget_text->setLayout(_layout_text);
    _layout_text->addWidget(_label_Y);
    _layout_text->addWidget(_label_AS);
    _layout_text->addWidget(_label_AL);

    STRType.append("常STR");
    STRName.append("Verifiler Plus");
    STRsys.append("10");


}

void GuideTable::init(PCRState *state){
    pState = state;
    _table0 = state->_table;
    tab2();
    tab1();
}


void GuideTable::showEvent(QShowEvent *event)
{


    datain();
    for(int r = 0; r < _table_data->rowCount(); r ++){
        if(! r%4 == 0){
            continue;
        }
        PosiName posi = _table_data->item(r, 1)->text();
        datacu(r, pState->avgConcList["FAM"], pState->avgConcList["VIC"], pState->avgConcList["ROX"], 0.2 , 30);
        pState->DI[posi] = _table_data->item(r, 12)->text().toDouble();
        pState->ICS[posi] = _table_data->item(r, 13)->text().toDouble();
        for(int c = 0; c < _table_data->columnCount(); c ++){
            if(_table_data->item(r, c) == nullptr) continue;
            if(_table_data->item(r, c)->text() == "inf"){
                _table_data->item(r, c)->setText(FAILURE_VALUE);
            }
        }
    }
    for(int r = 2; r < _table_plan->rowCount(); r ++){
        PosiName posi = _table_plan->item(r, 1)->text();
        dataca(r, pState->DI[posi], pState->ICS[posi], pState->avgConcList["FAM"],  pState->avgConcList["VIC"], pState->avgConcList["ROX"]);
        for(int c = 0; c < _table_plan->columnCount(); c ++){
            if(_table_plan->item(r, c) == nullptr) continue;
            if(_table_plan->item(r, c)->text() == "inf"){
                _table_plan->item(r, c)->setText(FAILURE_VALUE);
            }
        }

    }
    _table_data->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
    _table_plan->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);


    this->setUpdatesEnabled(false);
    if(pState->currentPage == PCRState::GUIDE_DATA){
        _table_data->show();
        _table_plan->hide();
    }else{
        _table_plan->show();
        _table_data->hide();
    }

    this->setUpdatesEnabled(true);

    // 更新按钮文字
    updateCount();



}

void GuideTable::on_pageChanged(){


    this->setUpdatesEnabled(false);
    if(pState->currentPage == PCRState::GUIDE_DATA){
        _table_data->show();
        _table_plan->hide();
    }else{
        _table_plan->show();
        _table_data->hide();
    }

    if(pState->E.contains("FAM") && pState->E.contains("ROX") && pState->E.contains("VIC") &&
       pState->standardLine.contains("FAM") && pState->standardLine.contains("ROX") && pState->standardLine.contains("VIC")){
        _label_Y->setText(QString("Y: 扩增效率:%1, 斜率: %2, R2: 0.999, Y轴截距: %3").arg(QString::number(pState->E["FAM"], 'f', 2), QString::number(pState->standardLine["FAM"][0], 'f', 2), QString::number(pState->standardLine["FAM"][1], 'f', 2)));
        _label_AL->setText(QString("Y: 扩增效率:%1, 斜率: %2, R2: 0.999, Y轴截距: %3").arg(QString::number(pState->E["ROX"], 'f', 2), QString::number(pState->standardLine["ROX"][0], 'f', 2), QString::number(pState->standardLine["ROX"][1], 'f', 2)));
        _label_AS->setText(QString("Y: 扩增效率:%1, 斜率: %2, R2: 0.999, Y轴截距: %3").arg(QString::number(pState->E["VIC"], 'f', 2), QString::number(pState->standardLine["VIC"][0], 'f', 2), QString::number(pState->standardLine["VIC"][1], 'f', 2)));

    }else{
        qDebug("更新扩增效率失败");
    }

    this->setUpdatesEnabled(true);

}

void GuideTable::updateCount(){
    pState->guide_count = _table_plan->rowCount()-2;
    int c=0,y=0,m=0,xs=0;
    for(int i=2;i<_table_plan->rowCount();i++){
        if(_table_plan->item(i,3)->text().contains("常STR")){
            c++;
        }
    }
    pState->guide_YSTR = _table_plan->rowCount()-2;
    for(int i=2;i<_table_plan->rowCount();i++){
        if(_table_plan->item(i,3)->text().contains("mini-STR")){
            m++;
        }
    }
    pState->guide_miniSTR = m;
    for(int i=2;i<_table_plan->rowCount();i++){
        if(!_table_plan->item(i,4)->text().contains("无")){
            xs++;
        }
    }
    pState->guide_dilute = xs;
    pState->emitGuideNumChanged();
}

void GuideTable::on_filterChanged(){


    datain();

    for(int i = 0; i < _table_data->rowCount(); i +=4){
        datacu(i, 0.2, 0.2, 0.2, 0.2, 30);
        for(int c = 0; c < _table_data->columnCount(); c ++){
            if(_table_data->item(i, c) == nullptr) continue;
            if(_table_data->item(i, c)->text() == "inf"){
                _table_data->item(i, c)->setText(FAILURE_VALUE);
            }
        }
    }
    for(int i = 2; i < _table_plan->rowCount(); i ++){
        dataca(i, 0.9, 0.1, 0.1, 0.1, 0.1);
        for(int c = 0; c < _table_plan->columnCount(); c ++){
            if(_table_plan->item(i, c) == nullptr) continue;
            if(_table_plan->item(i, c)->text() == "inf"){
                _table_plan->item(i, c)->setText(FAILURE_VALUE);
            }
        }
    }

    if(pState->currentPage == PCRState::GUIDE_DATA){
        _table_data->show();
        _table_plan->hide();
    }else{
        _table_plan->show();
        _table_data->hide();
    }
}



void GuideTable::tab1(){
    _table_data->setColumnCount(14);
    _table_data->setWindowTitle("QTableWidget & Item");
    _table_data->resizeColumnsToContents();
    _table_data->resizeRowsToContents();
    QStringList header;
    header<<"序号"<<"孔位"<<"样本名称"<<"样本类型"<<"荧光染料"<<"CT值"<<"样本浓度\nng/μl"<<
            "总浓度\nng/μl"<<"男性浓度\nng/μl"<<"女性浓度\nng/μl"<<"性别情况"<<"男女浓度\n比例"<<"降解指数\nDI"<<"抑制指数\nICS";
    _table_data->setHorizontalHeaderLabels(header);
    _table_data->verticalHeader()->hide();//取消行号
}

void GuideTable::tab2(){
    _table_plan->setColumnCount(13);
    _table_plan->setRowCount(2);
    _table_plan->setWindowTitle("QTableWidget & Item");
    _table_plan->horizontalHeader()->hide();//取消列号
    _table_plan->verticalHeader()->hide();//取消行号
    _table_plan->setItem(0,0,new QTableWidgetItem("序号"));
    _table_plan->setItem(0,1,new QTableWidgetItem("孔位"));
    _table_plan->setItem(0,2,new QTableWidgetItem("样本名称"));
    _table_plan->setItem(0,3,new QTableWidgetItem("检测方案"));
    _table_plan->setItem(0,4,new QTableWidgetItem("总稀释倍数\nDFa"));
    _table_plan->setItem(0,5,new QTableWidgetItem("第一步稀释步骤"));
    _table_plan->setItem(1,5,new QTableWidgetItem("稀释倍数1\nDFa1"));
    _table_plan->setItem(1,6,new QTableWidgetItem("样品体积\n(μl)"));
    _table_plan->setItem(1,7,new QTableWidgetItem("稀释液体积\n(μl)"));
    _table_plan->setItem(0,8,new QTableWidgetItem("第二步稀释步骤"));
    _table_plan->setItem(1,8,new QTableWidgetItem("稀释倍数2\nDFa2"));
    _table_plan->setItem(1,9,new QTableWidgetItem("上一步稀释\n产物(μl)"));
    _table_plan->setItem(1,10,new QTableWidgetItem("稀释液体积\n(μl)"));
    _table_plan->setItem(0,11,new QTableWidgetItem("扩增上样体积"));
    _table_plan->setItem(0,12,new QTableWidgetItem("备注"));

    for(int r = 0; r <= 1; r ++){
        for(int c = 0; c <= 12; c ++){
            if(_table_plan->item(r, c) == nullptr){
                continue;
            }
            _table_plan->item(r, c)->setBackground(QColor("white"));
            _table_plan->item(r, c)->setTextAlignment(Qt::AlignCenter);
        }
    }

    _table_plan->setSpan(0, 0, 2, 1);
    _table_plan->setSpan(0, 1, 2, 1);
    _table_plan->setSpan(0, 2, 2, 1);
    _table_plan->setSpan(0, 3, 2, 1);
    _table_plan->setSpan(0, 4, 2, 1);
    _table_plan->setSpan(0, 5, 1, 3);
    _table_plan->setSpan(0, 8, 1, 3);
    _table_plan->setSpan(0, 11, 2, 1);
    _table_plan->setSpan(0, 12, 2, 1);


}

void GuideTable::datain(){

    // _table_data
    _table_data->setRowCount(pState->posiList.size() * pState->channelList.size());
    int row = 0;
    foreach(PosiName posi, pState->posiList){
        foreach(ChannelName channel, pState->channelList){
            CurveName curve(channel, posi);
            _table_data->setItem(row, 0, new QTableWidgetItem(QString::number(row+1)));
            _table_data->setItem(row, 1, new QTableWidgetItem(posi));
            _table_data->setItem(row, 2, new QTableWidgetItem(pState->sampleInfo_posi[posi][1]));
            _table_data->setItem(row, 3, new QTableWidgetItem(pState->sampleInfo_posi[posi][2]));
            _table_data->setItem(row, 4, new QTableWidgetItem(channel));
            _table_data->setItem(row, 5, new QTableWidgetItem(QString::number(pState->Ct[curve])));
            qDebug() << curve;
            _table_data->setItem(row, 6, new QTableWidgetItem(QString::number(pState->concList[curve], 'f', 2)));
            row ++;
        }
    }


    _table_plan->setRowCount(pState->posiList.size()+2);
    row = 2;
    foreach(PosiName posi, pState->posiList){
        if(pState->sampleInfo_posi[posi][2] == "标准品"){
            continue;
        }
        _table_plan->setItem(row, 0, new QTableWidgetItem(QString::number(row-1)));
        _table_plan->setItem(row, 1, new QTableWidgetItem(posi));
        _table_plan->setItem(row, 2, new QTableWidgetItem(pState->sampleInfo_posi[posi][1]));
        row ++;
    }
    _table_plan->setRowCount(row);
}


void GuideTable::datacu(int row,double famn,double vicn,double roxn,double cqv,double cqbz){
    double R1,R2,R3,X1;
    QSqlDatabase db = dbHelper::openConnection();
    QString sql=QString("SELECT Num FROM MixedJudgment WHERE Parameter='%1'")
            .arg("R1");
    QSqlQuery query(db);
    query.exec(sql);
    while (query.next()) {
        R1 = query.value("Num").toDouble();
    }
    sql=QString("SELECT Num FROM MixedJudgment WHERE Parameter='%1'")
            .arg("R2");
    query.exec(sql);
    while (query.next()) {
        R2 = query.value("Num").toDouble();
    }
    sql=QString("SELECT Num FROM MixedJudgment WHERE Parameter='%1'")
            .arg("R3");
    query.exec(sql);
    while (query.next()) {
        R3 = query.value("Num").toDouble();
    }
    sql=QString("SELECT Num FROM MixedJudgment WHERE Parameter='%1'")
            .arg("X1");
    query.exec(sql);
    while (query.next()) {
        X1 = query.value("Num").toDouble();
    }
    _table_data->setItem(row,7,new QTableWidgetItem(QString::number(vicn,'f',2)));
    if(famn==0){
        if(vicn<X1){
            _table_data->setItem(row,8,new QTableWidgetItem("un"));
            _table_data->setItem(row,9,new QTableWidgetItem("un"));
            _table_data->setItem(row,10,new QTableWidgetItem("浓度过低无法判断"));
            _table_data->setItem(row,11,new QTableWidgetItem("-"));
        }else if(vicn>=X1){
            _table_data->setItem(row,8,new QTableWidgetItem("un"));
            _table_data->setItem(row,9,new QTableWidgetItem(QString::number(vicn,'f',2)));
            _table_data->setItem(row,10,new QTableWidgetItem("女"));
            _table_data->setItem(row,11,new QTableWidgetItem("-"));
        }
    }else if(vicn/famn<R1){
        _table_data->setItem(row,8,new QTableWidgetItem(QString::number(famn,'f',2)));
        _table_data->setItem(row,9,new QTableWidgetItem("un"));
        _table_data->setItem(row,10,new QTableWidgetItem("男"));
        _table_data->setItem(row,11,new QTableWidgetItem("-"));
    }else if(vicn/famn>=R1&&vicn<=X1){
        _table_data->setItem(row,8,new QTableWidgetItem(QString::number(famn,'f',2)));
        _table_data->setItem(row,9,new QTableWidgetItem("un"));
        _table_data->setItem(row,10,new QTableWidgetItem("男"));
        _table_data->setItem(row,11,new QTableWidgetItem("-"));
    }else if(vicn/famn>=R1&&vicn/famn<R2&&vicn>X1){
        _table_data->setItem(row,8,new QTableWidgetItem(QString::number(famn,'f',2)));
        _table_data->setItem(row,9,new QTableWidgetItem(QString::number(vicn-famn,'f',2)));
        _table_data->setItem(row,10,new QTableWidgetItem(">70%可能混"));
        _table_data->setItem(row,11,new QTableWidgetItem("1:"+QString::number((vicn-famn)/famn,'f',2)));
    }else if(vicn/famn>=R2&&vicn/famn<R3&&vicn>X1){
        _table_data->setItem(row,8,new QTableWidgetItem(QString::number(famn,'f',2)));
        _table_data->setItem(row,9,new QTableWidgetItem(QString::number(vicn-famn,'f',2)));
        _table_data->setItem(row,10,new QTableWidgetItem(">85%可能混"));
        _table_data->setItem(row,11,new QTableWidgetItem("1:"+QString::number((vicn-famn)/famn,'f',2)));
    }else if(vicn/famn>=R3&&vicn>X1){
        _table_data->setItem(row,8,new QTableWidgetItem(QString::number(famn,'f',2)));
        _table_data->setItem(row,9,new QTableWidgetItem(QString::number(vicn-famn,'f',2)));
        _table_data->setItem(row,10,new QTableWidgetItem(">95%可能混"));
        _table_data->setItem(row,11,new QTableWidgetItem("1:"+QString::number((vicn-famn)/famn,'f',2)));
    }
    _table_data->setItem(row,12,new QTableWidgetItem(QString::number(vicn/roxn,'f',2)));
    _table_data->setItem(row,13,new QTableWidgetItem(QString::number(cqv-cqbz,'f',2)));
}


void GuideTable::dataca(int row,double ICS,double DI,double AL,double AS,double Y){

    QMap<QString,QString> map;
    for(int i=0;i<STRType.length();i++){
        if(STRType.at(i)=="常STR"){
            QSqlDatabase db = dbHelper::openConnection();
            QString sql=QString("SELECT m.SystemName,m.SystemNum from DataAnalyseConfig d,ModelConfigurationNormal m where m.ID=d.ModelGuid and d.ReagentKitType='%1' and d.ReagentKitName='%2' and d.System='%3' ;")
                    .arg(STRType[i],STRName[i],STRsys[i]);
            QSqlQuery query(db);
            query.exec(sql);
            while (query.next()) {
                map.insert(query.value("SystemName").toString(),query.value("SystemNum").toString());
            }
        }else if(STRType.at(i)=="Y-STR"){
            QSqlDatabase db = dbHelper::openConnection();
            QString sql=QString("SELECT m.SystemName,m.SystemNum from DataAnalyseConfig d,ModelConfigurationY m where m.ID=d.ModelGuid and d.ReagentKitType='%1' and d.ReagentKitName='%2' and d.System='%3' ;")
                    .arg(STRType[i],STRName[i],STRsys[i]);
            QSqlQuery query(db);
            query.exec(sql);
            while (query.next()) {
                map.insert(query.value("SystemName").toString(),query.value("SystemNum").toString());
            }
        }else if(STRType.at(i)=="Mini-STR"){
            QSqlDatabase db = dbHelper::openConnection();
            QString sql=QString("SELECT m.SystemName,m.SystemNum from DataAnalyseConfig d,ModelConfigurationMini m where m.ID=d.ModelGuid and d.ReagentKitType='%1' and d.ReagentKitName='%2' and d.System='%3' ;")
                    .arg(STRType[i],STRName[i],STRsys[i]);
            QSqlQuery query(db);
            query.exec(sql);
            while (query.next()) {
                map.insert(query.value("SystemName").toString(),query.value("SystemNum").toString());
            }
        }

    }
    int a=STRType.indexOf("常STR");
    if(STRType.contains("常STR")&&STRsys.at(a)=="10"){
        map.insert("Da",QString::number(0.3*(1+(DI-1/DI))));
        map.insert("Db",QString::number(0.3*(1+(DI-1/DI))));
        map.insert("Dc",QString::number(0.3*(1+(DI-1/DI))));
        map.insert("Dd",QString::number(0.3*(1+(DI-1/DI))));
        map.insert("De",QString::number(0.3*(1+(DI-1/DI))));
        map.insert("MXa",QString::number(1.5/DI*(1+(DI-1)/DI)));
        map.insert("MXb",QString::number(1.5/DI*(1+(DI-1)/DI)));
        map.insert("MXc",QString::number(1.5/DI*(1+(DI-1)/DI)));
        map.insert("MXd",QString::number(1.5/DI*(1+(DI-1)/DI)));
        map.insert("MXe",QString::number(1.5/DI*(1+(DI-1)/DI)));
        double ASN2=map.value("Md").toDouble()/map.value("Mv").toDouble();
        double ASN3=map.value("Md").toDouble()/4;
        double ASN4=map.value("Md").toDouble()/3;
        double ASN5=map.value("Md").toDouble()/2;
        double ASN6=map.value("Mx").toDouble();
        double d = AL;
        double ALN1 = map.value("La").toDouble();
        double ALN2 = map.value("Da").toDouble()/map.value("Mv").toDouble();
        double ALN3 = map.value("Da").toDouble()/4;
        double ALN4 = map.value("Da").toDouble()/3;
        double ALN5 = map.value("Da").toDouble()/2;
        double ALN6 = map.value("MXa").toDouble();
        double ALN7 = map.value("Lb").toDouble();
        double ALN8 = map.value("Db").toDouble()/map.value("Mv").toDouble();
        double ALN9 = map.value("Db").toDouble()/4;
        double ALN10 = map.value("Db").toDouble()/3;
        double ALN11 = map.value("Db").toDouble()/2;
        double ALN12 = map.value("MXb").toDouble();
        double ALN13 = map.value("Lc").toDouble();
        double ALN14 = map.value("Dc").toDouble()/map.value("Mv").toDouble();
        double ALN15 = map.value("Dc").toDouble()/4;
        double ALN16 = map.value("Dc").toDouble()/3;
        double ALN17 = map.value("Dc").toDouble()/2;
        double ALN18 = map.value("MXc").toDouble();
        double ALN19 = map.value("Ld").toDouble();
        double ALN20 = map.value("Dd").toDouble()/map.value("Mv").toDouble();
        double ALN21 = map.value("Dd").toDouble()/4;
        double ALN22 = map.value("Dd").toDouble()/3;
        double ALN23 = map.value("Dd").toDouble()/2;
        double ALN24 = map.value("MXd").toDouble();
        double ALN25 = map.value("Le").toDouble();
        double ALN26 = map.value("De").toDouble()/map.value("Mv").toDouble();
        double ALN27 = map.value("De").toDouble()/4;
        double ALN28 = map.value("De").toDouble()/3;
        double ALN29 = map.value("De").toDouble()/2;
        double ALN30 = map.value("MXe").toDouble();
        _table_plan->setItem(row,3,new QTableWidgetItem("常STR"));
        if(ICS>=2){
            _table_plan->setItem(row,3,new QTableWidgetItem(map.value("检测方案")));
            _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            _table_plan->setItem(row,12,new QTableWidgetItem(map.value("备注")));
        }if(ICS<2&&DI<1.5){
            if(AS<ASN2){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Mv")+"ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(AS>=ASN2&&AS<=ASN3){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(AS>ASN3&&AS<=ASN4){
                _table_plan->setItem(row,11,new QTableWidgetItem("3ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(AS>ASN4&&AS<=ASN5){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(AS>ASN5&&AS<=ASN6){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(AS>ASN6){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至AS"+QString::number(map.value("Md").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(AS/(map.value("Md").toDouble()/2))));
            }

        }else if(ICS<2&&DI>=1.5&&DI<=4){
            if(d<ALN1){
                _table_plan->setItem(row,3,new QTableWidgetItem("mini-STR"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
                miniSTRfl=true;
            }else if(d>=ALN1&&d<=ALN2){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Mv")+"ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN2&&d<=ALN3){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN3&&d<=ALN4){
                _table_plan->setItem(row,11,new QTableWidgetItem("3ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN4&&d<=ALN5){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN5&&d<=ALN6){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN6){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至AL"+QString::number(map.value("Da").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(AL/(map.value("Da").toDouble()/2))));
            }
        }else if(ICS<2&&DI>4&&DI<=12){
            if(d<ALN7){
                _table_plan->setItem(row,3,new QTableWidgetItem("mini-STR"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
                miniSTRfl=true;
            }else if(d>=ALN7&&d<=ALN8){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Mv")+"ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN8&&d<=ALN9){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN9&&d<=ALN10){
                _table_plan->setItem(row,11,new QTableWidgetItem("3ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN10&&d<=ALN11){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN11&&d<=ALN12){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN12){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至AL"+QString::number(map.value("Db").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(AL/(map.value("Db").toDouble()/2))));
            }
        }else if(ICS<2&&DI>12&&DI<=20){
            if(d<ALN13){
                _table_plan->setItem(row,3,new QTableWidgetItem("mini-STR"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
                miniSTRfl=true;
            }else if(d>=ALN13&&d<=ALN14){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Mv")+"ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN14&&d<=ALN15){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN15&&d<=ALN16){
                _table_plan->setItem(row,11,new QTableWidgetItem("3ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN16&&d<=ALN17){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN17&&d<=ALN18){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN18){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至AL"+QString::number(map.value("Dc").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(AL/(map.value("Dc").toDouble()/2))));
            }
        }else if(ICS<2&&DI>20&&DI<=35){
            if(d<ALN19){
                _table_plan->setItem(row,3,new QTableWidgetItem("mini-STR"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
                miniSTRfl=true;
            }else if(d>=ALN19&&d<=ALN20){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Mv")+"ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN20&&d<=ALN21){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN21&&d<=ALN22){
                _table_plan->setItem(row,11,new QTableWidgetItem("3ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN22&&d<=ALN23){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN23&&d<=ALN24){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN24){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至AL"+QString::number(map.value("Dd").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(AL/(map.value("Dd").toDouble()/2))));
            }
        }else if(ICS<2&&DI>35&&DI<=80){
            if(d<ALN25){
                _table_plan->setItem(row,3,new QTableWidgetItem("mini-STR"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
                miniSTRfl=true;
            }else if(d>=ALN25&&d<=ALN26){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Mv")+"ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN26&&d<=ALN27){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN27&&d<=ALN28){
                _table_plan->setItem(row,11,new QTableWidgetItem("3ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN28&&d<=ALN29){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN29&&d<=ALN30){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN30){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至AL"+QString::number(map.value("De").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(AL/(map.value("De").toDouble()/2))));
            }
        }else if(ICS<2&&(DI>80||DI==0)){
            if(map.value("Ni").toInt()==0){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Mv")+"ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }if(map.value("Ni").toInt()==0){
                _table_plan->setItem(row,3,new QTableWidgetItem("mini-STR"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
                miniSTRfl=true;
            }
        }else{
            _table_plan->setItem(row,3,new QTableWidgetItem("常STR"));
            _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Mv")+"ul"));
            _table_plan->setItem(row,4,new QTableWidgetItem("无"));
        }
    }
    if(STRType.contains("常STR")&&STRsys.at(a)=="15"){
        map.insert("Da*",QString::number(0.3*(1+(DI-1/DI))));
        map.insert("Db*",QString::number(0.3*(1+(DI-1/DI))));
        map.insert("Dc*",QString::number(0.3*(1+(DI-1/DI))));
        map.insert("Dd*",QString::number(0.3*(1+(DI-1/DI))));
        map.insert("De*",QString::number(0.3*(1+(DI-1/DI))));
        map.insert("MXa*",QString::number(1.5/DI*(1+(DI-1)/DI)));
        map.insert("MXb*",QString::number(1.5/DI*(1+(DI-1)/DI)));
        map.insert("MXc*",QString::number(1.5/DI*(1+(DI-1)/DI)));
        map.insert("MXd*",QString::number(1.5/DI*(1+(DI-1)/DI)));
        map.insert("MXe*",QString::number(1.5/DI*(1+(DI-1)/DI)));
        double ASN2=map.value("Md*").toDouble()/map.value("Mv*").toDouble();
        double ASN3=map.value("Md*").toDouble()/15;
        double ASN4=map.value("Md*").toDouble()/12;
        double ASN5=map.value("Md*").toDouble()/10;
        double ASN6=map.value("Md*").toDouble()/8;
        double ASN7=map.value("Md*").toDouble()/6;
        double ASN8=map.value("Md*").toDouble()/4;
        double ASN9=map.value("Md*").toDouble()/2;
        double ASN10=map.value("Mx*").toDouble();
        double d = AL;
        double ALN1 = map.value("La*").toDouble();
        double ALN2 = map.value("Da*").toDouble()/map.value("Mv*").toDouble();
        double ALN3 = map.value("Da*").toDouble()/15;
        double ALN4 = map.value("Da*").toDouble()/12;
        double ALN5 = map.value("Da*").toDouble()/10;
        double ALN6 = map.value("Da*").toDouble()/8;
        double ALN7 = map.value("Da*").toDouble()/6;
        double ALN8 = map.value("Da*").toDouble()/4;
        double ALN9 = map.value("Da*").toDouble()/2;
        double ALN10 = map.value("MXa*").toDouble();
        double ALN11 = map.value("Lb*").toDouble();
        double ALN12 = map.value("Db*").toDouble()/map.value("Mv*").toDouble();
        double ALN13 = map.value("Db*").toDouble()/15;
        double ALN14 = map.value("Db*").toDouble()/12;
        double ALN15 = map.value("Db*").toDouble()/10;
        double ALN16 = map.value("Db*").toDouble()/8;
        double ALN17 = map.value("Db*").toDouble()/6;
        double ALN18 = map.value("Db*").toDouble()/4;
        double ALN19 = map.value("Db*").toDouble()/2;
        double ALN20 = map.value("MXb*").toDouble();
        double ALN21 = map.value("Lc*").toDouble();
        double ALN22 = map.value("Dc*").toDouble()/map.value("Mv*").toDouble();
        double ALN23 = map.value("Dc*").toDouble()/15;
        double ALN24 = map.value("Dc*").toDouble()/12;
        double ALN25 = map.value("Dc*").toDouble()/10;
        double ALN26 = map.value("Dc*").toDouble()/8;
        double ALN27 = map.value("Dc*").toDouble()/6;
        double ALN28 = map.value("Dc*").toDouble()/4;
        double ALN29 = map.value("Dc*").toDouble()/2;
        double ALN30 = map.value("MXc*").toDouble();
        double ALN31 = map.value("Ld*").toDouble();
        double ALN32 = map.value("Dd*").toDouble()/map.value("Mv*").toDouble();
        double ALN33 = map.value("Dd*").toDouble()/15;
        double ALN34 = map.value("Dd*").toDouble()/12;
        double ALN35 = map.value("Dd*").toDouble()/10;
        double ALN36 = map.value("Dd*").toDouble()/8;
        double ALN37 = map.value("Dd*").toDouble()/6;
        double ALN38 = map.value("Dd*").toDouble()/4;
        double ALN39 = map.value("Dd*").toDouble()/2;
        double ALN40 = map.value("MXd*").toDouble();
        double ALN41 = map.value("Le*").toDouble();
        double ALN42 = map.value("De*").toDouble()/map.value("Mv*").toDouble();
        double ALN43 = map.value("De*").toDouble()/15;
        double ALN44 = map.value("De*").toDouble()/12;
        double ALN45 = map.value("De*").toDouble()/10;
        double ALN46 = map.value("De*").toDouble()/8;
        double ALN47 = map.value("De*").toDouble()/6;
        double ALN48 = map.value("De*").toDouble()/4;
        double ALN49 = map.value("De*").toDouble()/2;
        double ALN50 = map.value("MXe*").toDouble();
        _table_plan->setItem(row,3,new QTableWidgetItem("常STR"));
        if(ICS>=2){
            _table_plan->setItem(row,3,new QTableWidgetItem(map.value("检测方案")));
            _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            _table_plan->setItem(row,12,new QTableWidgetItem(map.value("备注")));
        }if(ICS<2&&DI<1.5){
            if(AS<ASN2){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Mv*")));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(AS>=ASN2&&AS<=ASN3){
                _table_plan->setItem(row,11,new QTableWidgetItem("15ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(AS>ASN3&&AS<=ASN4){
                _table_plan->setItem(row,11,new QTableWidgetItem("12ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(AS>ASN4&&AS<=ASN5){
                _table_plan->setItem(row,11,new QTableWidgetItem("10ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(AS>ASN5&&AS<=ASN6){
                _table_plan->setItem(row,11,new QTableWidgetItem("8ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(AS>ASN6&&AS<=ASN7){
                _table_plan->setItem(row,11,new QTableWidgetItem("6ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(AS>ASN7&&AS<=ASN8){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(AS>ASN8&&AS<=ASN9){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(AS>ASN9&&AS<=ASN10){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(AS>ASN10){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至AS"+QString::number(map.value("Md*").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(AS/(map.value("Md*").toDouble()/2))));
            }

        }else if(ICS<2&&DI>=1.5&&DI<=4){
            if(d<ALN1){
                _table_plan->setItem(row,3,new QTableWidgetItem("mini-STR"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>=ALN1&&d<=ALN2){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Mv*")));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN2&&d<=ALN3){
                _table_plan->setItem(row,11,new QTableWidgetItem("15ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN3&&d<=ALN4){
                _table_plan->setItem(row,11,new QTableWidgetItem("12ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN4&&d<=ALN5){
                _table_plan->setItem(row,11,new QTableWidgetItem("10ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN5&&d<=ALN6){
                _table_plan->setItem(row,11,new QTableWidgetItem("8ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN6&&d<=ALN7){
                _table_plan->setItem(row,11,new QTableWidgetItem("6ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN7&&d<=ALN8){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN8&&d<=ALN9){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN9&&d<=ALN10){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN10){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至AL"+QString::number(map.value("Da*").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(AL/(map.value("Da*").toDouble()/2))));
            }
        }else if(ICS<2&&DI>4&&DI<=12){
            if(d<ALN11){
                _table_plan->setItem(row,3,new QTableWidgetItem("mini-STR"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>=ALN11&&d<=ALN12){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Mv*")));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN12&&d<=ALN13){
                _table_plan->setItem(row,11,new QTableWidgetItem("15ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN13&&d<=ALN14){
                _table_plan->setItem(row,11,new QTableWidgetItem("12ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN14&&d<=ALN15){
                _table_plan->setItem(row,11,new QTableWidgetItem("10ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN15&&d<=ALN16){
                _table_plan->setItem(row,11,new QTableWidgetItem("8ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN16&&d<=ALN17){
                _table_plan->setItem(row,11,new QTableWidgetItem("6ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN17&&d<=ALN18){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN18&&d<=ALN19){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN19&&d<=ALN20){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN20){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至AL"+QString::number(map.value("Db*").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(AL/(map.value("Db*").toDouble()/2))));
            }
        }else if(ICS<2&&DI>12&&DI<=20){
            if(d<ALN21){
                _table_plan->setItem(row,3,new QTableWidgetItem("mini-STR"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>=ALN21&&d<=ALN22){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Mv*")));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN22&&d<=ALN23){
                _table_plan->setItem(row,11,new QTableWidgetItem("15ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN23&&d<=ALN24){
                _table_plan->setItem(row,11,new QTableWidgetItem("12ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN24&&d<=ALN25){
                _table_plan->setItem(row,11,new QTableWidgetItem("8ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN25&&d<=ALN26){
                _table_plan->setItem(row,11,new QTableWidgetItem("6ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN26&&d<=ALN27){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN27&&d<=ALN28){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN28&&d<=ALN29){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN29&&d<=ALN30){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN30){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至AL"+QString::number(map.value("Dc*").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(AL/(map.value("Dc*").toDouble()/2))));
            }
        }else if(ICS<2&&DI>20&&DI<=35){
            if(d<ALN31){
                _table_plan->setItem(row,3,new QTableWidgetItem("mini-STR"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>=ALN31&&d<=ALN32){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Mv*")));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN32&&d<=ALN33){
                _table_plan->setItem(row,11,new QTableWidgetItem("15ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN33&&d<=ALN34){
                _table_plan->setItem(row,11,new QTableWidgetItem("12ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN34&&d<=ALN35){
                _table_plan->setItem(row,11,new QTableWidgetItem("10ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN35&&d<=ALN36){
                _table_plan->setItem(row,11,new QTableWidgetItem("8ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN36&&d<=ALN37){
                _table_plan->setItem(row,11,new QTableWidgetItem("6ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN37&&d<=ALN38){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN38&&d<=ALN39){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN39&&d<=ALN40){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN40){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至AL"+QString::number(map.value("Dd*").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(AL/(map.value("Dd*").toDouble()/2))));
            }
        }else if(ICS<2&&DI>35&&DI<=80){
            if(d<ALN41){
                _table_plan->setItem(row,3,new QTableWidgetItem("mini-STR"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>=ALN41&&d<=ALN42){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Mv*")));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN42&&d<=ALN43){
                _table_plan->setItem(row,11,new QTableWidgetItem("15ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN43&&d<=ALN44){
                _table_plan->setItem(row,11,new QTableWidgetItem("12ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN44&&d<=ALN45){
                _table_plan->setItem(row,11,new QTableWidgetItem("10ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN45&&d<=ALN46){
                _table_plan->setItem(row,11,new QTableWidgetItem("8ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN46&&d<=ALN47){
                _table_plan->setItem(row,11,new QTableWidgetItem("6ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN47&&d<=ALN48){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN48&&d<=ALN49){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN49&&d<=ALN50){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>ALN50){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至AL"+QString::number(map.value("De*").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(AL/(map.value("De*").toDouble()/2))));
            }
        }else if(ICS<2&&(DI>80||DI==0)){
            if(map.value("Ni").toInt()==0){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Mv*")));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }if(map.value("Ni").toInt()==0){
                _table_plan->setItem(row,3,new QTableWidgetItem("mini-STR"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }
        }else{
            _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Mv*")));
            _table_plan->setItem(row,4,new QTableWidgetItem("无"));
        }
    }
    if(YSTRfl&&STRType.contains("Y-STR")){
        map.insert("YDa",QString::number(1.1*(1+(DI-1)/DI)));
        map.insert("YDb",QString::number(1.1*(1+(DI-1)/DI)));
        map.insert("YDc",QString::number(1.1*(1+(DI-1)/DI)));
        map.insert("YDd",QString::number(1.1*(1+(DI-1)/DI)));
        map.insert("YDe",QString::number(1.1*(1+(DI-1)/DI)));
        map.insert("YXa",QString::number(1.2*(1+(DI-1)/DI)));
        map.insert("YXb",QString::number(1.2*(1+(DI-1)/DI)));
        map.insert("YXc",QString::number(1.2*(1+(DI-1)/DI)));
        map.insert("YXd",QString::number(1.2*(1+(DI-1)/DI)));
        map.insert("YXe",QString::number(1.2*(1+(DI-1)/DI)));
        double d = Y;
        double Y1 = map.value("Yd").toDouble()/map.value("Yv").toDouble();
        double Y2 = map.value("Yd").toDouble()/4;
        double Y3 = map.value("Yd").toDouble()/3;
        double Y4 = map.value("Yd").toDouble()/2;
        double Y5 = map.value("Yx").toDouble();
        double Y6 = map.value("YDa").toDouble()/map.value("Yv").toDouble();
        double Y7 = map.value("YDa").toDouble()/4;
        double Y8 = map.value("YDa").toDouble()/3;
        double Y9 = map.value("YDa").toDouble()/2;
        double Y10 = map.value("YDa").toDouble()/1.5;
        double Y11 = map.value("YXa").toDouble();
        double Y12 = map.value("YDb").toDouble()/map.value("Yv").toDouble();
        double Y13 = map.value("YDb").toDouble()/4;
        double Y14 = map.value("YDb").toDouble()/3;
        double Y15 = map.value("YDb").toDouble()/2;
        double Y16 = map.value("YDb").toDouble()/1.5;
        double Y17 = map.value("YXb").toDouble();
        double Y18 = map.value("YDc").toDouble()/map.value("Yv").toDouble();
        double Y19 = map.value("YDc").toDouble()/4;
        double Y20 = map.value("YDc").toDouble()/3;
        double Y21 = map.value("YDc").toDouble()/2;
        double Y22 = map.value("YDc").toDouble()/1.5;
        double Y23 = map.value("YXc").toDouble();
        double Y24 = map.value("YDd").toDouble()/map.value("Yv").toDouble();
        double Y25 = map.value("YDd").toDouble()/4;
        double Y26 = map.value("YDd").toDouble()/3;
        double Y27 = map.value("YDd").toDouble()/2;
        double Y28 = map.value("YDd").toDouble()/1.5;
        double Y29 = map.value("YXd").toDouble();
        double Y30 = map.value("YDe").toDouble()/map.value("Yv").toDouble();
        double Y31 = map.value("YDe").toDouble()/4;
        double Y32 = map.value("YDe").toDouble()/3;
        double Y33 = map.value("YDe").toDouble()/2;
        double Y34 = map.value("YDe").toDouble()/1.5;
        double Y35 = map.value("YXe").toDouble();
        _table_plan->setItem(row,3,new QTableWidgetItem("Y-STR"));
        if(DI<=2){
            if(d<Y1){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Yv")+"ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>=Y1&&d<=Y2){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y2&&d<=Y3){
                _table_plan->setItem(row,11,new QTableWidgetItem("3ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y3&&d<=Y4){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y4&&d<=Y5){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y5){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至Y"+QString::number(map.value("Yd*").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(Y/(map.value("Yd*").toDouble()/2))));
            }
        }else if(DI>2&&DI<=4){
            if(d<Y6){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Yv")+"ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>=Y6&&d<=Y7){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y7&&d<=Y8){
                _table_plan->setItem(row,11,new QTableWidgetItem("3ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y8&&d<=Y9){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y9&&d<=Y10){
                _table_plan->setItem(row,11,new QTableWidgetItem("1.5ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y10&&d<=Y11){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y11){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至Y"+QString::number(map.value("YDa*").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(Y/(map.value("YDa*").toDouble()/2))));
            }
        }else if(DI>4&&DI<=12){
            if(d<Y12){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Yv")+"ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>=Y12&&d<=Y13){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y13&&d<=Y14){
                _table_plan->setItem(row,11,new QTableWidgetItem("3ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y14&&d<=Y15){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y15&&d<=Y16){
                _table_plan->setItem(row,11,new QTableWidgetItem("1.5ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y16&&d<=Y17){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y17){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至Y"+QString::number(map.value("YDb*").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(Y/(map.value("YDb*").toDouble()/2))));
            }
        }else if(DI>12&&DI<=20){
            if(d<Y18){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Yv")+"ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>=Y18&&d<=Y19){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y19&&d<=Y20){
                _table_plan->setItem(row,11,new QTableWidgetItem("3ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y20&&d<=Y21){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y21&&d<=Y22){
                _table_plan->setItem(row,11,new QTableWidgetItem("1.5ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y22&&d<=Y23){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y23){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至Y"+QString::number(map.value("YDc*").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(Y/(map.value("YDc*").toDouble()/2))));
            }
        }else if(DI>20&&DI<=35){
            if(d<Y24){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Yv")+"ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>=Y24&&d<=Y25){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y25&&d<=Y26){
                _table_plan->setItem(row,11,new QTableWidgetItem("3ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y26&&d<=Y27){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y27&&d<=Y28){
                _table_plan->setItem(row,11,new QTableWidgetItem("1.5ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y28&&d<=Y29){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y29){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至Y"+QString::number(map.value("YDd*").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(Y/(map.value("YDd*").toDouble()/2))));
            }
        }else if(DI>35&&DI<=80){
            if(d<Y30){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Yv")+"ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>=Y30&&d<=Y31){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y31&&d<=Y32){
                _table_plan->setItem(row,11,new QTableWidgetItem("3ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y32&&d<=Y33){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y33&&d<=Y34){
                _table_plan->setItem(row,11,new QTableWidgetItem("1.5ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y34&&d<=Y35){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>Y35){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至Y"+QString::number(map.value("YDe*").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(Y/(map.value("YDe*").toDouble()/2))));
            }
        }else if(DI>80||DI==0){
            if(map.value("Ni").toInt()==1){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Yv")+"ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(map.value("Ni").toInt()==0){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("")));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }
        }else{
            _table_plan->setItem(row,11,new QTableWidgetItem(map.value("")));
            _table_plan->setItem(row,4,new QTableWidgetItem("无"));
        }
    }
    if(miniSTRfl&&STRType.contains("Mini-STR")&&_table_plan->item(row,3)->text()=="mini-STR"){
        map.insert("Ia",QString::number(0.25*(1+(DI-1)/DI)));
        map.insert("Ib",QString::number(0.25*(1+(DI-1)/DI)));
        map.insert("Ic",QString::number(0.25*(1+(DI-1)/DI)));
        map.insert("Id",QString::number(0.25*(1+(DI-1)/DI)));
        map.insert("Ie",QString::number(0.25*(1+(DI-1)/DI)));
        map.insert("IXa",QString::number(1.2*(1+(DI-1)/DI)));
        map.insert("IXb",QString::number(1.2*(1+(DI-1)/DI)));
        map.insert("IXc",QString::number(1.2*(1+(DI-1)/DI)));
        map.insert("IXd",QString::number(1.2*(1+(DI-1)/DI)));
        map.insert("IXe",QString::number(1.2*(1+(DI-1)/DI)));
        double d = AL;
        double M1 = map.value("Is").toDouble()/map.value("Iv").toDouble();
        double M2 = map.value("Is").toDouble()/4;
        double M3 = map.value("Is").toDouble()/3;
        double M4 = map.value("Is").toDouble()/2;
        double M5 = map.value("Ix").toDouble();
        double M6 = map.value("Ia").toDouble()/map.value("Iv").toDouble();
        double M7 = map.value("Ia").toDouble()/4;
        double M8 = map.value("Ia").toDouble()/3;
        double M9 = map.value("Ia").toDouble()/2;
        double M10 = map.value("IXa").toDouble();
        double M11 = map.value("Ib").toDouble()/map.value("Iv").toDouble();
        double M12 = map.value("Ib").toDouble()/4;
        double M13 = map.value("Ib").toDouble()/3;
        double M14 = map.value("Ib").toDouble()/2;
        double M15 = map.value("IXb").toDouble();
        double M16 = map.value("Ic").toDouble()/map.value("Iv").toDouble();
        double M17 = map.value("Ic").toDouble()/4;
        double M18 = map.value("Ic").toDouble()/3;
        double M19 = map.value("Ic").toDouble()/2;
        double M20 = map.value("IXc").toDouble();
        double M21 = map.value("Id").toDouble()/map.value("Iv").toDouble();
        double M22 = map.value("Id").toDouble()/4;
        double M23 = map.value("Id").toDouble()/3;
        double M24 = map.value("Id").toDouble()/2;
        double M25 = map.value("IXd").toDouble();
        double M26 = map.value("Ie").toDouble()/map.value("Iv").toDouble();
        double M27 = map.value("Ie").toDouble()/4;
        double M28 = map.value("Ie").toDouble()/3;
        double M29 = map.value("Ie").toDouble()/2;
        double M30 = map.value("IXe").toDouble();
        if(DI<1.5){
            if(AS<M1){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Iv")+"ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(AS>=M1&&AS<=M2){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(AS>M2&&AS<=M3){
                _table_plan->setItem(row,11,new QTableWidgetItem("3ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(AS>M3&&AS<=M4){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(AS>M4&&AS<=M5){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(AS>M5){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至AS"+QString::number(map.value("Is*").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(AS/(map.value("Is*").toDouble()/2))));
            }
        }else if(DI>=1.5&&DI<=4){
            if(d<M6){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Iv")+"ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>=M6&&d<=M7){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>M7&&d<=M8){
                _table_plan->setItem(row,11,new QTableWidgetItem("3ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>M8&&d<=M9){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>M9&&d<=M10){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>M10){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至AL"+QString::number(map.value("Ia*").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(AL/(map.value("Ia*").toDouble()/2))));
            }
        }else if(DI>4&&DI<=12){
            if(d<M11){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Iv")+"ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>=M11&&d<=M12){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>M12&&d<=M13){
                _table_plan->setItem(row,11,new QTableWidgetItem("3ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>M13&&d<=M14){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>M14&&d<=M15){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>M15){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至AL"+QString::number(map.value("Ib*").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(AL/(map.value("Ib*").toDouble()/2))));
            }
        }else if(DI>12&&DI<=20){
            if(d<M16){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Iv")+"ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>=M16&&d<=M17){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>M17&&d<=M18){
                _table_plan->setItem(row,11,new QTableWidgetItem("3ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>M18&&d<=M19){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>M19&&d<=M20){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>M20){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至AL"+QString::number(map.value("Ic*").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(AL/(map.value("Ic*").toDouble()/2))));
            }
        }else if(DI>20&&DI<=35){
            if(d<M21){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Iv")+"ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>=M21&&d<=M22){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>M22&&d<=M23){
                _table_plan->setItem(row,11,new QTableWidgetItem("3ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>M23&&d<=M24){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>M24&&d<=M25){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>M25){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至AL"+QString::number(map.value("Id*").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(AL/(map.value("Id*").toDouble()/2))));
            }
        }else if(DI>35&&DI<=80){
            if(d<M26){
                _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Iv")+"ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>=M26&&d<=M27){
                _table_plan->setItem(row,11,new QTableWidgetItem("4ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>M27&&d<=M28){
                _table_plan->setItem(row,11,new QTableWidgetItem("3ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>M28&&d<=M29){
                _table_plan->setItem(row,11,new QTableWidgetItem("2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>M29&&d<=M30){
                _table_plan->setItem(row,11,new QTableWidgetItem("1ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem("无"));
            }else if(d>M30){
                _table_plan->setItem(row,11,new QTableWidgetItem("稀释至AL"+QString::number(map.value("Ie*").toDouble()/2)+"ng/ul上样2ul"));
                _table_plan->setItem(row,4,new QTableWidgetItem(QString::number(AL/(map.value("Ie*").toDouble()/2))));
            }
        }else if(DI>80||DI==0){
            _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Iv")+"ul"));
            _table_plan->setItem(row,4,new QTableWidgetItem("无"));
        }else{
            _table_plan->setItem(row,11,new QTableWidgetItem(map.value("Iv")+"ul"));
            _table_plan->setItem(row,4,new QTableWidgetItem("无"));
        }
    }

    if(_table_plan->item(row,3) != nullptr){

        xsui(row,_table_plan->item(row,3)->text(),5);
    }
    miniSTRfl=false;
}

void GuideTable::xsui(int row,QString type,int tx){
    if(type=="常STR"){
        if(_table_plan->item(row,4)->text()=="无"){
            _table_plan->setItem(row,5,new QTableWidgetItem("无"));
            _table_plan->setItem(row,6,new QTableWidgetItem("无"));
            _table_plan->setSpan(row, 6, 1, 2);
            _table_plan->setItem(row,8,new QTableWidgetItem("无"));
            _table_plan->setItem(row,9,new QTableWidgetItem("无"));
            _table_plan->setSpan(row, 9, 1, 2);
        }else if(_table_plan->item(row,4)->text().toInt()<=100){
            _table_plan->setItem(row,5,new QTableWidgetItem(_table_plan->item(row,4)->text()));
            _table_plan->setItem(row,6,new QTableWidgetItem(QString::number(tx,'f',2)));
            _table_plan->setItem(row,7,new QTableWidgetItem(QString::number(tx*_table_plan->item(row,4)->text().toDouble()-tx,'f',2)));
            _table_plan->setItem(row,8,new QTableWidgetItem("无"));
            _table_plan->setItem(row,9,new QTableWidgetItem("无"));
            _table_plan->setSpan(row, 9, 1, 2);
        }else if(_table_plan->item(row,4)->text().toInt()<=1000&&_table_plan->item(row,4)->text().toInt()>100){
            _table_plan->setItem(row,5,new QTableWidgetItem(20));
            _table_plan->setItem(row,6,new QTableWidgetItem(QString::number(tx,'f',2)));
            _table_plan->setItem(row,7,new QTableWidgetItem(QString::number(tx*20-tx,'f',2)));
            _table_plan->setItem(row,8,new QTableWidgetItem(QString::number(_table_plan->item(row,4)->text().toDouble()/20,'f',2)));
            _table_plan->setItem(row,9,new QTableWidgetItem(QString::number(tx,'f',2)));
            _table_plan->setItem(row,10,new QTableWidgetItem(QString::number(tx*_table_plan->item(row,4)->text().toDouble()/20-tx,'f',2)));
        }else if(_table_plan->item(row,4)->text().toInt()>1000){
            _table_plan->setItem(row,5,new QTableWidgetItem(QString::number(50)));
            _table_plan->setItem(row,6,new QTableWidgetItem(QString::number(tx,'f',2)));
            _table_plan->setItem(row,7,new QTableWidgetItem(QString::number(tx*50-tx,'f',2)));
            _table_plan->setItem(row,8,new QTableWidgetItem(QString::number(_table_plan->item(row,4)->text().toDouble()/50,'f',2)));
            _table_plan->setItem(row,9,new QTableWidgetItem(QString::number(tx,'f',2)));
            _table_plan->setItem(row,10,new QTableWidgetItem(QString::number(tx*_table_plan->item(row,4)->text().toDouble()/50-tx,'f',2)));
        }
    }else if(type=="Y-STR"){
        if(_table_plan->item(row,4)->text()=="无"){
            _table_plan->setItem(row,5,new QTableWidgetItem("无"));
            _table_plan->setItem(row,6,new QTableWidgetItem("无"));
            _table_plan->setSpan(row, 6, 1, 2);
            _table_plan->setItem(row,8,new QTableWidgetItem("无"));
            _table_plan->setItem(row,9,new QTableWidgetItem("无"));
            _table_plan->setSpan(row, 9, 1, 2);
        }else if(_table_plan->item(row,4)->text().toInt()<=100){
            _table_plan->setItem(row,5,new QTableWidgetItem(_table_plan->item(row,4)->text()));
            _table_plan->setItem(row,6,new QTableWidgetItem(tx));
            _table_plan->setItem(row,7,new QTableWidgetItem(tx*_table_plan->item(row,4)->text().toInt()-tx));
            _table_plan->setItem(row,8,new QTableWidgetItem("无"));
            _table_plan->setItem(row,9,new QTableWidgetItem("无"));
            _table_plan->setSpan(row, 9, 1, 2);
        }else if(_table_plan->item(row,4)->text().toInt()<=1000&&_table_plan->item(row,4)->text().toInt()>100){
            _table_plan->setItem(row,5,new QTableWidgetItem(20));
            _table_plan->setItem(row,6,new QTableWidgetItem(tx));
            _table_plan->setItem(row,7,new QTableWidgetItem(tx*20-tx));
            _table_plan->setItem(row,8,new QTableWidgetItem(_table_plan->item(row,4)->text().toInt()/20));
            _table_plan->setItem(row,9,new QTableWidgetItem(tx));
            _table_plan->setItem(row,10,new QTableWidgetItem(tx*_table_plan->item(row,4)->text().toInt()/20)-tx);
        }else if(_table_plan->item(row,4)->text().toInt()>1000){
            _table_plan->setItem(row,5,new QTableWidgetItem(50));
            _table_plan->setItem(row,6,new QTableWidgetItem(tx));
            _table_plan->setItem(row,7,new QTableWidgetItem(tx*50-tx));
            _table_plan->setItem(row,8,new QTableWidgetItem(_table_plan->item(row,4)->text().toInt()/50));
            _table_plan->setItem(row,9,new QTableWidgetItem(tx));
            _table_plan->setItem(row,10,new QTableWidgetItem(tx*_table_plan->item(row,4)->text().toInt()/50)-tx);
        }
    }else if(type=="mini-STR"){
        if(_table_plan->item(row,4)->text()=="无"){
            _table_plan->setItem(row,5,new QTableWidgetItem("无"));
            _table_plan->setItem(row,6,new QTableWidgetItem("无"));
            _table_plan->setSpan(row, 6, 1, 2);
            _table_plan->setItem(row,8,new QTableWidgetItem("无"));
            _table_plan->setItem(row,9,new QTableWidgetItem("无"));
            _table_plan->setSpan(row, 9, 1, 2);
        }else if(_table_plan->item(row,4)->text().toInt()<=100){
            _table_plan->setItem(row,5,new QTableWidgetItem(_table_plan->item(row,4)->text()));
            _table_plan->setItem(row,6,new QTableWidgetItem(tx));
            _table_plan->setItem(row,7,new QTableWidgetItem(tx*_table_plan->item(row,4)->text().toInt()-tx));
            _table_plan->setItem(row,8,new QTableWidgetItem("无"));
            _table_plan->setItem(row,9,new QTableWidgetItem("无"));
            _table_plan->setSpan(row, 9, 1, 2);
        }else if(_table_plan->item(row,4)->text().toInt()<=1000&&_table_plan->item(row,4)->text().toInt()>100){
            _table_plan->setItem(row,5,new QTableWidgetItem(20));
            _table_plan->setItem(row,6,new QTableWidgetItem(tx));
            _table_plan->setItem(row,7,new QTableWidgetItem(tx*20-tx));
            _table_plan->setItem(row,8,new QTableWidgetItem(_table_plan->item(row,4)->text().toInt()/20));
            _table_plan->setItem(row,9,new QTableWidgetItem(tx));
            _table_plan->setItem(row,10,new QTableWidgetItem(tx*_table_plan->item(row,4)->text().toInt()/20)-tx);
        }else if(_table_plan->item(row,4)->text().toInt()>1000){
            _table_plan->setItem(row,5,new QTableWidgetItem(50));
            _table_plan->setItem(row,6,new QTableWidgetItem(tx));
            _table_plan->setItem(row,7,new QTableWidgetItem(tx*50-tx));
            _table_plan->setItem(row,8,new QTableWidgetItem(_table_plan->item(row,4)->text().toInt()/50));
            _table_plan->setItem(row,9,new QTableWidgetItem(tx));
            _table_plan->setItem(row,10,new QTableWidgetItem(tx*_table_plan->item(row,4)->text().toInt()/50)-tx);
        }
    }
}
